package homework;

import java.util.Scanner;

public class Addition {
    public static void main(String[] args) {
        Scanner scan =new Scanner(System.in);
        int score=0;
        for (int i = 0; i < 10; i++) {
            int a=(int)(Math.random()*100+1);
            int b=(int)(Math.random()*100+1);
            int guess =a+b;
            System.out.println(a+"+"+b+"=？");
            System.out.println("猜吧");
            int answer =scan.nextInt();
            if (answer==guess){
                System.out.println("答对了");
                score+=10;
            }else {
                System.out.println("答错了");
            }
        }
        System.out.println("总分为"+score);









    }
}
